home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / Turbo Prolog 2 / EXAMPL40.PRO < prev    next >
Encoding:
Prolog Source  |  1986-04-25  |  855 b   |  31 lines

  1.                 /* Program 40 */
  2. domains
  3.     list=integer*
  4. predicates
  5.     spotlight(integer,integer,integer)
  6.     xy(list)
  7.     undo
  8. goal
  9.     graphics(2,0,1),
  10.     makewindow(1,7,7,"First",1,1,18,70),
  11.     xy([0,0,0,6000,4000,20500,20000,24000,16100,1000]),
  12.     xy([0,0,0,9000,3000,26500,20100,24400,20100,1000]),
  13.   
  14.     makewindow(2,7,7,"Second",10,20,14,60),
  15.     xy([0,1000,0,9000,0,20000,15000,20000,15000,1000]),
  16.     makewindow(3,7,7,"Text",15,0,6,35),
  17.     write(""),nl,
  18.     write("Turbo Prolog window & graphics."),
  19.     undo,undo,undo.
  20. clauses
  21.     xy([X,Y|Rest]):-
  22.         spotlight(15,X,Y),!,xy(Rest).
  23.     xy(_).
  24.      spotlight(0,_,_):-!.
  25.      spotlight(N,R,C):-
  26.         X=N*1200,line(R,C,9000,X,1),N1=N-1,
  27.         spotlight(N1,R,C).
  28.      undo:-
  29.         write("\n\nPress the space bar"),
  30.         readchar(_),removewindow.
  31.